<?php
session_start();
date_default_timezone_set('PRC');
header("Content-type: text/html; charset=utf-8");

require(APP_DIR.'/vendor/autoload.php');
require(APP_DIR.'/protected/lib/common.php');
// require(APP_DIR.'/protected/lib/functions.php');
require(APP_DIR.'/protected/lib/template.php');

$router = require(APP_DIR.'/protected/config/router.php');
$domain = require(APP_DIR.'/protected/config/database.php');

// 为了避免开始使用时会不正确配置域名导致程序错误，加入判断
if(empty($domain[$_SERVER['HTTP_HOST']])) die("配置域名不正确，请确认".$_SERVER['HTTP_HOST']."的配置是否存在！");

return $domain[$_SERVER['HTTP_HOST']] + $router;